package top.stmo.spring.ioc.test1.service.impl;

import top.stmo.spring.ioc.test1.dao.BookDao;
import top.stmo.spring.ioc.test1.dao.impl.BookDaoImpl;
import top.stmo.spring.ioc.test1.service.BookService;

import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

public class BookServiceImpl implements BookService {

//    private BookDao bookDao = new BookDaoImpl();

    private BookDao bookDao;

    private List list;
    private int[] array;
    private Set set;
    private Map map;
    private Properties properties;


    public BookServiceImpl() {
    }

    public BookServiceImpl(BookDao bookDao) {
        this.bookDao = bookDao;
    }

    public void save() {
        System.out.println("book service save");
        bookDao.save();
    }

    //提供对应的set方法
    public void setBookDao(BookDao bookDao) {
        this.bookDao = bookDao;
    }

    public void setList(List list) {
        this.list = list;
    }

    public void setArray(int[] array) {
        this.array = array;
    }

    public void setSet(Set set) {
        this.set = set;
    }

    public void setMap(Map map) {
        this.map = map;
    }

    public void setProperties(Properties properties) {
        this.properties = properties;
    }

    @Override
    public String toString() {
        return "BookServiceImpl{" +
                "bookDao=" + bookDao +
                ", list=" + list +
                ", array=" + array +
                ", set=" + set +
                ", map=" + map +
                ", properties=" + properties +
                '}';
    }
}
